import { CurrentUser } from '@/decorators';
import { PointsListDto } from '@/dtos';
import { PointsService } from '@/services/points.service';
import { ok } from '@/utils';
import { Body, Controller, Post } from '@nestjs/common';
import { BaseController } from './base.controller';

@Controller('points')
export class PointsController extends BaseController {
  constructor(private readonly pointsService: PointsService) {
    super();
  }

  @Post('list')
  async getLogList(@Body() dto: PointsListDto, @CurrentUser('id') id: number) {
    return ok(await this.pointsService.getList(id, dto));
  }
}
